﻿using BCCommon;
using BCCommon.Enums.Driver;
using BCCommon.TMS.Order;
using BCCommon.TMS.Transport;
using BCDto.Common.ErrorMessage;
using BCDto.Location;
using BCDto.TMS.Order;
using BCDto.TMS.Order.OrderEvaluation;
using BCDto.TMS.Order.OrderPool;
using BCDto.TMS.Order.OrderProcess;
using BCDto.TMS.OrderExtentionGoodsChecklist;
using BCDto.TMS.OrderFreightAppendRecord;
using BCDto.TMS.OrderFreightRecord;
using BCDto.TMS.OrderPackingRecord;
using BCDto.TMS.OrderSpecificServiceRecord;
using BCDto.TMS.OrderTranstionRecord;
using BCService.TMS.Order;
using BCService.TMS.Order.Order;
using BCService.TMS.Order.OrderEvaluation;
using BCService.TMS.OrderExtentionGoodsChecklist;
using BCService.TMS.OrderFreightRecord;
using BCService.TMS.OrderPackingRecord;
using BCService.TMS.OrderSpecificServiceRecord;
using BCService.TMS.OrderTranstionRecord;
using BCService.TMS.TransportOrder;
using BCService.TMS.VehicleSuiteBusinessConfig;
using BCService.Utils;
using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.Net;

namespace BCTMSRESTful.Controllers.DriverApp.Order
{
    [Route("api/v1/DriverApp/[controller]")]
    [ApiExplorerSettings(GroupName = "DriverApp")]
    public class OrderController : DriverAppBaseController
    {
        private readonly IOrderProcessService orderProcessService;
        private readonly IOrderPoolService orderPoolService;
        private readonly IOrderExtentionGoodsChecklistService orderExtentionGoodsChecklistService;
        private readonly IOrderFreightRecordService orderFreightRecordService;
        private readonly IOrderSpecificServiceRecordService orderSpecificServiceRecordService;
        private readonly IOrderPackingRecordService orderPackingRecordService;
        private readonly IOrderEvaluationService orderEvaluationService;
        private readonly ITransportOrderService transportOrderService;
        private readonly IVehicleSuiteBusinessConfigService vehicleSuiteBusinessConfigService;
        private readonly IOrderTranstionRecordService orderTranstionRecordService;
        public OrderController(IOrderProcessService orderProcessService,
            IOrderPoolService orderPoolService,
            ITransportOrderService transportOrderService,
            IVehicleSuiteBusinessConfigService vehicleSuiteBusinessConfigService,
            IOrderExtentionGoodsChecklistService orderExtentionGoodsChecklistService,
            IOrderFreightRecordService orderFreightRecordService,
            IOrderEvaluationService orderEvaluationService,
            IOrderSpecificServiceRecordService orderSpecificServiceRecordService,
            IOrderPackingRecordService orderPackingRecordService,
            IOrderTranstionRecordService orderTranstionRecordService)
        {
            this.orderProcessService = orderProcessService;
            this.orderPoolService = orderPoolService;
            this.orderExtentionGoodsChecklistService = orderExtentionGoodsChecklistService;
            this.orderFreightRecordService = orderFreightRecordService;
            this.orderSpecificServiceRecordService = orderSpecificServiceRecordService;
            this.orderPackingRecordService = orderPackingRecordService;
            this.orderEvaluationService = orderEvaluationService;
            this.transportOrderService = transportOrderService;
            this.vehicleSuiteBusinessConfigService = vehicleSuiteBusinessConfigService;
            this.orderTranstionRecordService = orderTranstionRecordService;
        }

        #region 获取货物清单
        /// <summary>
        /// 获取货物清单
        /// </summary>
        /// <param name="orderId">订单Id</param>
        /// <returns></returns>
        /// <response code="200">获取已接单订单列表。</response>
        /// <response code="400">请求参数或输入的数据不正确。</response>
        /// <response code="401">请求需要认证或者认证信息已过期。</response>
        /// <response code="403">无权访问指定的功能。</response>
        /// <response code="500">服务器发生错误。</response>
        /// <response code="501">某些功能尚未实现。</response>
        [HttpGet("[action]/{order_id}")]
        [ProducesResponseType(typeof(IEnumerable<OrderExtentionGoodsChecklistDto>), 200)]
        public IActionResult GoodsChecklist([FromRoute(Name = "order_id")] long orderId)
        {
            return this.Ok(this.orderExtentionGoodsChecklistService.GetList(orderId));
        }
        #endregion

        #region 获取订单费用清单
        /// <summary>
        /// 获取订单费用清单
        /// </summary>
        /// <param name="orderId">订单Id</param>
        /// <returns></returns>
        /// <response code="200">获取订单费用清单。</response>
        /// <response code="400">请求参数或输入的数据不正确。</response>
        /// <response code="401">请求需要认证或者认证信息已过期。</response>
        /// <response code="403">无权访问指定的功能。</response>
        /// <response code="500">服务器发生错误。</response>
        /// <response code="501">某些功能尚未实现。</response>
        [HttpGet("[action]/{order_id}")]
        [ProducesResponseType(typeof(IEnumerable<OrderFreightRecordDto>), 200)]
        public IActionResult FreightRecord([FromRoute(Name = "order_id")] long orderId)
        {
            return this.Ok(this.orderFreightRecordService.GetList(orderId));
        }
        #endregion

        #region 获取订单特殊服务
        /// <summary>
        /// 获取订单特殊服务
        /// </summary>
        /// <param name="orderId">订单Id</param>
        /// <returns></returns>
        /// <response code="200">获取订单特殊服务。</response>
        /// <response code="400">请求参数或输入的数据不正确。</response>
        /// <response code="401">请求需要认证或者认证信息已过期。</response>
        /// <response code="403">无权访问指定的功能。</response>
        /// <response code="500">服务器发生错误。</response>
        /// <response code="501">某些功能尚未实现。</response>
        [HttpGet("[action]/{order_id}")]
        [ProducesResponseType(typeof(IEnumerable<OrderSpecificServiceRecordDto>), 200)]
        public IActionResult SpecificService([FromRoute(Name = "order_id")] long orderId)
        {
            return this.Ok(this.orderSpecificServiceRecordService.GetList(orderId));
        }
        #endregion

        #region 获取订单包装材料
        /// <summary>
        /// 获取订单包装材料
        /// </summary>
        /// <param name="orderId">订单Id</param>
        /// <returns></returns>
        /// <response code="200">获取订单包装材料。</response>
        /// <response code="400">请求参数或输入的数据不正确。</response>
        /// <response code="401">请求需要认证或者认证信息已过期。</response>
        /// <response code="403">无权访问指定的功能。</response>
        /// <response code="500">服务器发生错误。</response>
        /// <response code="501">某些功能尚未实现。</response>
        [HttpGet("[action]/{order_id}")]
        [ProducesResponseType(typeof(IEnumerable<OrderPackingRecordDto>), 200)]
        public IActionResult Packing([FromRoute(Name = "order_id")] long orderId)
        {
            return this.Ok(this.orderPackingRecordService.GetList(orderId));
        }
        #endregion

        #region 获取待抢订单列表

        /// <summary>
        /// 获取待抢订单列表
        /// </summary>
        /// <param name="transportBusinessType">运输业务</param> 
        /// <param name="index">页码。</param>
        /// <param name="size">页数</param>
        /// <returns></returns>
        /// <response code="200">订单列表。</response>
        /// <response code="400">请求参数或输入的数据不正确。</response>
        /// <response code="401">请求需要认证或者认证信息已过期。</response>
        /// <response code="403">无权访问指定的功能。</response>
        /// <response code="500">服务器发生错误。</response>
        /// <response code="501">某些功能尚未实现。</response>
        [HttpGet("[action]")]
        [ProducesResponseType(typeof(PageableList<OrderDto>), 200)]
        [ProducesResponseType(typeof(ErrorMessageDto), 400)]
        [ProducesResponseType(typeof(ErrorMessageDto), 500)]
        public IActionResult Newest(TransportBusinessType? transportBusinessType, [FromQuery(Name = "index")] int index = 1, [FromQuery(Name = "size")] int size = 10)
        {

            return this.Ok(this.orderProcessService.DriverAppQueryPendingOrders(this.Driver, transportBusinessType, index, size));
        }
        #endregion

        #region 获取指定的订单信息

        /// <summary>
        /// 获取指定的订单信息
        /// </summary>  
        /// <returns></returns>
        /// <response code="200">订单列表。</response>
        /// <response code="400">请求参数或输入的数据不正确。</response>
        /// <response code="401">请求需要认证或者认证信息已过期。</response>
        /// <response code="403">无权访问指定的功能。</response>
        /// <response code="500">服务器发生错误。</response>
        /// <response code="501">某些功能尚未实现。</response>
        [HttpGet("{order_id}")]
        [ProducesResponseType(typeof(OrderDto), 200)]
        [ProducesResponseType(typeof(ErrorMessageDto), 400)]
        [ProducesResponseType(typeof(ErrorMessageDto), 500)]
        public IActionResult Get([FromRoute(Name = "order_id")] long orderId)
        {
            return this.Ok(this.orderProcessService.GetWithDriver(this.Driver.DriverId, orderId));
        }

        #endregion

        #region 指派订单接受

        #region 获取指派订单列表

        /// <summary>
        /// 获取指派订单列表
        /// </summary>
        /// <response code="200">订单列表</response>
        /// <response code="400">请求参数或输入的数据不正确。</response>
        /// <response code="500">服务器发生错误。</response>
        /// <response code="501">某些功能尚未实现。</response>
        /// <returns></returns>
        [HttpGet("[action]")]
        [ProducesResponseType(typeof(PageableList<OrderPoolDto>), 200)]
        [ProducesResponseType(typeof(ErrorMessageDto), 400)]
        [ProducesResponseType(typeof(ErrorMessageDto), 500)]
        public IActionResult QueryAssign([FromQuery(Name = "index")] int? pageIndex = 1,
            [FromQuery(Name = "size")] int? pageSize = 10)
        {
            if (this.Driver == null)
            {
                throw new ArgumentException("司机信息不存在");
            }
            return Ok(this.orderPoolService.GetDriverOrders(OrderAssignHandleStatus.Processing, this.Driver.DriverId, pageIndex.Value, pageSize.Value));
        }
        #endregion

        #region 司机忽略指派订单
        /// <summary>
        /// 司机忽略指派订单
        /// </summary>
        /// <param name="orderId">订单Id</param>
        /// <response code="200">订单信息</response>
        /// <response code="400">请求参数或输入的数据不正确。</response>
        /// <response code="500">服务器发生错误。</response>
        /// <response code="501">某些功能尚未实现。</response>
        /// <returns></returns>
        [HttpPut("[action]/{order_id}")]
        [ProducesResponseType(typeof(OrderDto), 200)]
        [ProducesResponseType(typeof(ErrorMessageDto), 400)]
        [ProducesResponseType(typeof(ErrorMessageDto), 500)]
        public IActionResult ClearAssign([FromRoute(Name = "order_id")] long orderId)
        {
            if (this.Driver == null)
            {
                throw new ArgumentException("车辆信息不存在");
            }
            this.orderPoolService.IgnoreOrderAssign(this.Driver.DriverId, orderId);
            return Ok();
        }
        #endregion

        #region 接单指派订单
        /// <summary>
        /// 司机接单指派订单
        /// </summary>
        /// <param name="orderId">订单Id</param>
        /// <response code="200">订单信息</response>
        /// <response code="400">请求参数或输入的数据不正确。</response>
        /// <response code="500">服务器发生错误。</response>
        /// <response code="501">某些功能尚未实现。</response>
        /// <returns></returns>
        [HttpPut("[action]/{order_id}")]
        [ProducesResponseType(typeof(OrderPoolDto), 200)]
        [ProducesResponseType(typeof(ErrorMessageDto), 400)]
        [ProducesResponseType(typeof(ErrorMessageDto), 500)]
        public IActionResult ReceiveAssign([FromRoute(Name = "order_id")] long orderId)
        {
            if (this.Driver == null)
            {
                throw new ArgumentException("司机信息不存在");
            }
            return Ok(this.orderPoolService.ReceiveOrderAssign(this.Driver, orderId));
        }
        #endregion

        #endregion




        #region 获取已接单列表

        /// <summary>
        /// 获取已接单列表
        /// </summary>
        /// <param name="driverAppOrderStatus">订单状态</param> 
        /// <param name="index">页码。</param>
        /// <param name="size">页数</param>
        /// <returns></returns>
        /// <response code="200">获取已接单订单列表。</response>
        /// <response code="400">请求参数或输入的数据不正确。</response>
        /// <response code="401">请求需要认证或者认证信息已过期。</response>
        /// <response code="403">无权访问指定的功能。</response>
        /// <response code="500">服务器发生错误。</response>
        /// <response code="501">某些功能尚未实现。</response>
        [HttpGet("[action]")]
        [ProducesResponseType(typeof(PageableList<OrderDto>), 200)]
        [ProducesResponseType(typeof(ErrorMessageDto), 400)]
        [ProducesResponseType(typeof(ErrorMessageDto), 500)]
        public IActionResult Query(DriverAppOrderStatus driverAppOrderStatus, [FromQuery(Name = "index")] int index = 1, [FromQuery(Name = "size")] int size = 10)
        {
            if (this.Driver.DriverStatus == DriverStatus.Success)
            {
                return this.Ok(this.orderProcessService.DriverAppQueryOrders(driverAppOrderStatus, this.Driver.DriverId, index, size));
            }
            else
            {
                return Ok(new PageableList<OrderDto>());
            }
        }
        #endregion

        #region 手动调用已到达
        /// <summary>
        /// 手动调用已到达
        /// </summary>
        /// <param name="orderId">订单Id</param>
        /// <param name="coordinateDto">坐标</param>
        /// <response code="200">订单列表</response>
        /// <response code="400">请求参数或输入的数据不正确。</response>
        /// <response code="500">服务器发生错误。</response>
        /// <response code="501">某些功能尚未实现。</response>
        /// <returns></returns>
        [HttpPut("[action]/{order_id}")]
        [ProducesResponseType(typeof(bool), 200)]
        [ProducesResponseType(typeof(ErrorMessageDto), 400)]
        [ProducesResponseType(typeof(ErrorMessageDto), 500)]
        public IActionResult Arrived([FromRoute(Name = "order_id")] long orderId, [FromBody] CoordinateBsonDto coordinateDto)
        {
            if (this.Driver == null)
            {
                throw new ArgumentException("车辆信息不存在");
            }
            this.orderProcessService.UpdateOrderExtentionAddressStatus(this.Driver, orderId, coordinateDto, false);
            return Ok();
        }
        #endregion

        #region 司机装货
        /// <summary>
        /// 司机装货
        /// </summary>
        /// <param name="orderLoadingRequestDto">订单装货请求信息</param>
        /// <response code="200">订单列表</response>
        /// <response code="400">请求参数或输入的数据不正确。</response>
        /// <response code="500">服务器发生错误。</response>
        /// <response code="501">某些功能尚未实现。</response>
        /// <returns></returns>
        [HttpPut("[action]")]
        [ProducesResponseType(typeof(OrderDto), 200)]
        [ProducesResponseType(typeof(ErrorMessageDto), 400)]
        [ProducesResponseType(typeof(ErrorMessageDto), 500)]
        public IActionResult LoadingFreight([FromBody] OrderLoadingRequestDto orderLoadingRequestDto)
        {
            if (this.Driver == null)
            {
                throw new ArgumentException("车辆信息不存在");
            }
            return Ok(this.orderProcessService.OrderLoading(this.Driver, orderLoadingRequestDto));
        }
        #endregion

        #region 司机出发--司机装货地出发
        /// <summary>
        /// 司机出发--司机装货地出发
        /// </summary>
        /// <param name="orderLoadingRequestDto">订单装货请求信息</param>
        /// <response code="200">订单列表</response>
        /// <response code="400">请求参数或输入的数据不正确。</response>
        /// <response code="500">服务器发生错误。</response>
        /// <response code="501">某些功能尚未实现。</response>
        /// <returns></returns>
        [HttpPut("[action]")]
        [ProducesResponseType(typeof(OrderDto), 200)]
        [ProducesResponseType(typeof(ErrorMessageDto), 400)]
        [ProducesResponseType(typeof(ErrorMessageDto), 500)]
        public IActionResult StartOut([FromBody] OrderStartOutRequestDto orderLoadingRequestDto)
        {
            if (this.Driver == null)
            {
                throw new ArgumentException("车辆信息不存在");
            }
            return Ok(this.orderProcessService.StartOut(this.Driver, orderLoadingRequestDto));
        }
        #endregion

      

        #region 司机签收签字
        /// <summary>
        /// 司机签收签字
        /// </summary>
        /// <param name="orderAcceptanceSignatureRequestDto">订单签收签字请求</param>
        /// <response code="200">订单列表</response>
        /// <response code="400">请求参数或输入的数据不正确。</response>
        /// <response code="500">服务器发生错误。</response>
        /// <response code="501">某些功能尚未实现。</response>
        /// <returns></returns>
        [HttpPut("[action]")]
        [ProducesResponseType(typeof(OrderDto), 200)]
        [ProducesResponseType(typeof(ErrorMessageDto), 400)]
        [ProducesResponseType(typeof(ErrorMessageDto), 500)]
        public IActionResult AcceptanceSignature([FromBody] OrderAcceptanceSignatureRequestDto orderAcceptanceSignatureRequestDto)
        {
            if (this.Driver == null)
            {
                throw new ArgumentException("车辆信息不存在");
            }
            return Ok(this.orderProcessService.AcceptanceSignature(this.Driver, orderAcceptanceSignatureRequestDto));
        }
        #endregion

        #region 司机录入回单-原始回单照片
        /// <summary>
        /// 司机录入回单-原始回单照片
        /// </summary>
        /// <param name="orderReceiptPhotoRequestDto">订单回单请求信息</param>
        /// <response code="200">订单列表</response>
        /// <response code="400">请求参数或输入的数据不正确。</response>
        /// <response code="500">服务器发生错误。</response>
        /// <response code="501">某些功能尚未实现。</response>
        /// <returns></returns>
        [HttpPut("[action]")]
        [ProducesResponseType(typeof(OrderDto), 200)]
        [ProducesResponseType(typeof(ErrorMessageDto), 400)]
        [ProducesResponseType(typeof(ErrorMessageDto), 500)]
        public IActionResult SourceReceiptPhoto([FromBody] OrderReceiptPhotoRequestDto orderReceiptPhotoRequestDto)
        {
            if (this.Driver == null)
            {
                throw new ArgumentException("车辆信息不存在");
            }
            return Ok(this.orderProcessService.SourceReceiptPhoto(this.Driver, orderReceiptPhotoRequestDto));
        }
        #endregion

        #region 司机录入回单-签收后回单照片
        /// <summary>
        /// 司机录入回单-签收后回单照片
        /// </summary>
        /// <param name="orderReceiptPhotoRequestDto">订单回单请求信息</param>
        /// <response code="200">订单列表</response>
        /// <response code="400">请求参数或输入的数据不正确。</response>
        /// <response code="500">服务器发生错误。</response>
        /// <response code="501">某些功能尚未实现。</response>
        /// <returns></returns>
        [HttpPut("[action]")]
        [ProducesResponseType(typeof(OrderDto), 200)]
        [ProducesResponseType(typeof(ErrorMessageDto), 400)]
        [ProducesResponseType(typeof(ErrorMessageDto), 500)]
        public IActionResult AcceptanceReceiptPhoto([FromBody] OrderReceiptPhotoRequestDto orderReceiptPhotoRequestDto)
        {
            if (this.Driver == null)
            {
                throw new ArgumentException("车辆信息不存在");
            }
            return Ok(this.orderProcessService.AcceptanceReceiptPhoto(this.Driver, orderReceiptPhotoRequestDto));
        }
        #endregion

        #region 二次负重
        /// <summary>
        ///二次负重
        /// </summary>
        /// <response code="200">负重完成的订单。</response>
        /// <response code="204">无法找到指定的订单。</response>
        /// <response code="400">请求参数或输入的数据不正确。</response>
        /// <response code="401">请求需要认证或者认证信息已过期。</response>
        /// <response code="403">无权访问指定的功能。</response>
        /// <response code="500">服务器发生错误。</response>
        /// <response code="501">某些功能尚未实现。</response>
        /// <returns></returns>
        [HttpPost("[action]/{order_no}")]
        [ProducesResponseType(typeof(OrderFreightAppendRecordDto), 200)]
        [ProducesResponseType(typeof(ErrorMessageDto), 400)]
        [ProducesResponseType(typeof(ErrorMessageDto), 500)]
        public IActionResult ChangeWeight([FromBody] OrderChangeWeightRequestDto orderChangeWeightRequestDto)
        {
            OrderDto orderDto = orderProcessService.GetOrder(orderChangeWeightRequestDto.OrderNo);
            if (orderDto == null)
            {
                throw new ArgumentException("订单信息不存在");
            }
            orderChangeWeightRequestDto.Driver = this.Driver;
            if (orderDto.VehicleSuiteBusinessConfigId.HasValue)
            {
                var vehicleSuiteBusiness = vehicleSuiteBusinessConfigService.Get(orderDto.VehicleSuiteBusinessConfigId.Value);
                IOrderService orderSuiteService = transportOrderService.GetOrderService(orderDto.TransportBusiness.As<TransportBusinessType>(), vehicleSuiteBusiness.SuiteBusinessType);
                orderChangeWeightRequestDto.SuiteBusinessType = vehicleSuiteBusiness.SuiteBusinessType;
                return Ok(orderSuiteService.ChangeWeight(orderChangeWeightRequestDto));
            }
            IOrderService orderService = transportOrderService.GetOrderService(orderDto.TransportBusiness.As<TransportBusinessType>(), null);
            return Ok(orderService.ChangeWeight(orderChangeWeightRequestDto));
        }

        #endregion

        #region 司机评价
        /// <summary>
        /// 司机评价
        /// </summary>
        /// <param name="orderVehicleEvaluationRequestDto">司机订单评价</param>
        /// <response code="200">司机评价</response>
        /// <returns></returns>
        [HttpPut("[action]")]
        [ProducesResponseType(typeof(OrderEvaluationDto), 200)]
        public IActionResult Evaluate([FromBody] OrderVehicleEvaluationRequestDto orderVehicleEvaluationRequestDto)
        {
            if (this.Driver == null)
            {
                throw new ArgumentException("司机信息不存在");
            }

            OrderEvaluationDto orderEvaluationDto = new OrderEvaluationDto()
            {
                DriverId = this.Driver.DriverId,
                OrderId = orderVehicleEvaluationRequestDto.OrderId,
                VehicleEvaluation = orderVehicleEvaluationRequestDto.VehicleEvaluation,
                VehicleEvaluationContent = orderVehicleEvaluationRequestDto.VehicleEvaluationContent
            };
            return Ok(this.orderEvaluationService.VehicleEvaluate(orderEvaluationDto));
        }
        #endregion

        #region 订单流转记录
        #region 获取订单流转记录
        /// <summary>
        ///  获取订单流转记录
        /// </summary>
        /// <param name="orderTranstionRecordId">订单流转记录Id</param>
        /// <response code="200">获取订单流转记录</response>
        /// <response code="400">请求参数或输入的数据不正确。</response>
        /// <response code="500">服务器发生错误。</response>
        /// <response code="501">某些功能尚未实现。</response>
        /// <returns></returns>
        [HttpGet("[action]/{order_transtion_record_id}")]
        [ProducesResponseType(typeof(OrderTranstionRecordDto), 200)]
        public IActionResult TranstionRecord([FromRoute(Name = "order_transtion_record_id")] long orderTranstionRecordId)
        {
            return StatusCode((int)HttpStatusCode.OK, this.orderTranstionRecordService.Get(orderTranstionRecordId));
        }
        #endregion

        #region 获取订单流转记录列表
        /// <summary>
        ///  获取订单流转记录列表
        /// </summary>
        /// <response code="200">获取订单流转记录列表</response>
        /// <response code="400">请求参数或输入的数据不正确。</response>
        /// <response code="500">服务器发生错误。</response>
        /// <response code="501">某些功能尚未实现。</response>
        /// <returns></returns>
        [HttpGet("[action]/{order_id}")]
        [ProducesResponseType(typeof(IEnumerable<OrderTranstionRecordDto>), 200)]
        public IActionResult TranstionRecordTimeline([FromRoute(Name = "order_id")] long orderId)
        {
            return StatusCode((int)HttpStatusCode.OK, this.orderTranstionRecordService.GetList(orderId));
        }
        #endregion
        #endregion

        #region 订单签收
        /// <summary>
        /// 订单签收
        /// </summary>
        /// <param name="orderSignPersonRequestDto">订单签收人请求信息</param>
        /// <response code="200">订单列表</response>
        /// <response code="400">请求参数或输入的数据不正确。</response>
        /// <response code="500">服务器发生错误。</response>
        /// <response code="501">某些功能尚未实现。</response>
        /// <returns></returns>
        [HttpPut("[action]")]
        [ProducesResponseType(typeof(OrderDto), 200)]
        [ProducesResponseType(typeof(ErrorMessageDto), 400)]
        [ProducesResponseType(typeof(ErrorMessageDto), 500)]
        public IActionResult OrderSign([FromBody] OrderSignPersonRequestDto orderSignPersonRequestDto)
        {
            if (this.Driver == null)
            {
                throw new ArgumentException("车辆信息不存在");
            }
            return Ok(this.orderProcessService.OrderSign(this.Driver, orderSignPersonRequestDto));
        }
        #endregion

    }
}
